@echo on

rem =======================================================
rem postbuild.cmd usage:
rem     
rem     %1 = top (where src is)
rem     %2 = type (retail debug, or both)
rem     %3 = title (jobname)
rem     %4 = buildnumber (title.version+p4 change)
rem =======================================================

set RTL=e:\build\%3.%4\retail
set DBG=e:\build\%3.%4\debug

set COPYCMD=/y

if "%2" == "retail" goto doretail
if "%2" == "debug" goto dodebug
if "%2" == "both" goto doretail
goto end

:doretail
if not exist %RTL% md %RTL%
if "%2" == "both" goto dodebug
goto copylogs

:dodebug
if not exist %DBG% md %DBG%
goto copylogs

:copylogs
xcopy *.log e:\build\%3.%4
goto leave

:end
@echo nothing to do!

:leave
